<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        /* 最外层 */
        .content {
            display: flex;
            flex-direction: row;
        }
        /* END */
        
        /* 每个菜单的样式(宽度这里调,子菜单宽度都听这个) */
        .items {
            width: 130px;
            color: #fff;
        }
        /* END */
        
        /* 菜单与鼠标移入 */
        .menu{
            width: 100%;
            height: 45px;
            background: red;
            line-height: 45px;
            text-align: center;
            position: relative;
            overflow: hidden;
        }
        .menu:hover{
            overflow: visible;
            background: black;
            color: white;
            z-index: 999;
            cursor: pointer;
        }
        /* END */
        
        /* 下拉菜单与鼠标移入 */
        .drop{
            background: red;
            text-align: center;
            width: 100%;
            height: 45px;
            line-height: 45px;
            overflow: hidden;
        }
        .drop:hover{
            background: black;
            cursor: pointer;
        }
        /* END */

    </style>
</head>
<body>
    <section class="content">
        <!-- 有菜单 -->
        <div class="items">
            <div class="menu">
                <span>有菜单</span>
                <div>
                    <div class="drop">选项A</div>
                    <div class="drop">选项B</div>
                    <div class="drop">选项C</div>
                </div>
            </div>
        </div>
        <!-- END -->
    
        <!-- 无下级 -->
        <div class="items">
            <div class="menu">
                <span>无菜单</span>
                <div></div>
            </div>
        </div>
        <!-- END -->
    </section>
    
</body>
</html>